#pragma once

#include <string>
#include <vector>

namespace kratos { namespace corelib {

struct OS {
    // transmit from domain to IP
    // @param host domain host name
    // @return IP
    static std::string getHostIP(const std::string& host);
    // returns the absobulte file path of executable binary
    // @return the absobulte file path of executable binary
    static std::string getExePath();
    // returns the executable binary file name
    static std::string getExeName();
    // Collect all files in directory
    // @param directory Directory
    // @param suffix File extension
    // @param fileNames result
    // @retval true
    // @retval false fail
    static bool getFiles(const std::string& directory, const std::string suffix, std::vector<std::string>& fileNames);
    // Check existence of directory
    // @param path Directory
    // @retval true
    // @retval false 
    static bool isExists(const std::string& path);
    // Remove file
    // @param filePath The file path
    // @retval true
    // @retval false 
    static bool removeFile(const std::string& filePath);
    // Completes the path
    // @param base the base directory
    // @param sub sub-directory or file name
    // @return the joined path
    static std::string completePath(const std::string& base, const std::string& sub);
    // Renames the file
    // @param srcFileName old file name
    // @param newFileName new file name
    // @retval true
    // @retval false 
    static bool renameFile(const std::string& srcFileName, const std::string& newFileName);
    // Returns file's suffix
    // @param fileName The file path
    static std::string getExtension(const std::string& fileName);
    // Returns the random number between a and b
    static std::uint32_t getRandom(std::uint32_t a, std::uint32_t b);
};

}}
